import 'package:flutter_test/flutter_test.dart';
import 'package:andserver_flutter/andserver_flutter.dart';
import 'package:andserver_flutter/andserver_flutter_platform_interface.dart';
import 'package:andserver_flutter/andserver_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAndserverFlutterPlatform
    with MockPlatformInterfaceMixin
    implements AndserverFlutterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AndserverFlutterPlatform initialPlatform = AndserverFlutterPlatform.instance;

  test('$MethodChannelAndserverFlutter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAndserverFlutter>());
  });

  test('getPlatformVersion', () async {
    AndserverFlutter andserverFlutterPlugin = AndserverFlutter();
    MockAndserverFlutterPlatform fakePlatform = MockAndserverFlutterPlatform();
    AndserverFlutterPlatform.instance = fakePlatform;

    expect(await andserverFlutterPlugin.getPlatformVersion(), '42');
  });
}
